package com.qunar.support.web;

import java.io.PrintWriter;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.qunar.support.service.UserService;
import com.qunar.support.util.IntegerUtils;

public class OperateUserServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1632650132077689054L;

	public void service(HttpServletRequest request, HttpServletResponse response) {
		try {
			String uid0=request.getParameter("uid");
			int uid=IntegerUtils.valueOf(uid0);
			String opt0=request.getParameter("opt");
			int opt=IntegerUtils.valueOf(opt0);

			response.setCharacterEncoding("utf8");
			PrintWriter out = response.getWriter();
			
			System.out.println(uid+"        "+opt);
			UserService us=new UserService();
			String result=us.opetateUser(uid, opt);
			out.println(result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
